<levels>
{foreach from=$levels item=level}
	<level>
		<value>{$level->getLevel()}</value>
		<type>{$level->getPointTypeId()}</type>
		<title>{$level->getTitle()}</title>
		<img>{$level->getImagePath()}</img>
		<score>
			<from>{$level->getPoints()}</from>
{assign var=upperPoints value=""}
{foreach from=$levels1upper item=levelUpper}
{if $levelUpper->getPointTypeId() eq $level->getPointTypeId()}
{if $levelUpper->getLevel() eq ($level->getLevel()+1)}
{assign var=upperPoints value=$levelUpper->getPoints()}
{/if}
{/if}
{/foreach}
			<to>{$upperPoints}</to>
{assign var=currPointVal value=""}
{foreach from=$currPoints item=currPoint}
{if $level->getPointTypeId() eq $currPoint->getPointTypeId()}
{assign var=currPointVal value=$currPoint->getPoint()}
{/if}
{/foreach}
			<current>{$currPointVal}</current>
		</score>
	</level>
{/foreach}
</levels>